package cn.school.student.common.enumdir;

import lombok.Getter;

@Getter
public enum IsAlienEnum {

    not("非港澳台侨外",0),
    gui("归侨",1),
    hua("华侨",2),
    qiao("侨眷",3),
    gangao("港澳",4),
    tai("台胞",5),
    wai("外籍华人",6);

    IsAlienEnum(String label,Integer value){
        this.label=label;
        this.value=value;
    }

    private String label;

    private Integer value;

    //通过label获取对应的枚举实例
    public static IsAlienEnum getByLabel(String name) {
        IsAlienEnum [] list = values();
        for (IsAlienEnum isAlienEnum : list) {
            if ((isAlienEnum.label).equals(name)) {
                return isAlienEnum;
            }
        }
        return null;
    }

}
